package com.example.spring.demo.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.spring.demo.common.model.req.CollectParam;
import com.example.spring.demo.entity.Goods;
import com.example.spring.demo.entity.GoodsCollect;
import com.example.spring.demo.mapper.GoodsCollectMapper;
import com.example.spring.demo.service.GoodsCollectService;
import org.springframework.stereotype.Service;

/**
 * @author qwert
 * @version 1.0.0
 * @create 2024/12/31 10:51
 **/
@Service
public class GoodsCollectServiceImpl extends ServiceImpl<GoodsCollectMapper,GoodsCollect> implements GoodsCollectService {
    // 获取我的收藏
    @Override
    public IPage<Goods> getMyCollect(CollectParam param) {
//构造分页对象
        IPage<Goods> page = new Page<>(param.getCurPage(),param.getPageSize());
        return this.baseMapper.getMyCollect(page,param.getUserId());
    }
}